package cn.iocoder.yudao.module.biz.dal.mysql.trainingPlan;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.biz.dal.dataobject.trainingPlan.BizTrainingPlanDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.biz.controller.admin.trainingPlan.vo.*;

/**
 * 培训计划 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface BizTrainingPlanMapper extends BaseMapperX<BizTrainingPlanDO> {

    default PageResult<BizTrainingPlanDO> selectPage(BizTrainingPlanPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BizTrainingPlanDO>()
                .likeIfPresent(BizTrainingPlanDO::getPlanName, reqVO.getPlanName())
                .orderByDesc(BizTrainingPlanDO::getId));
    }

    default List<BizTrainingPlanDO> selectList(BizTrainingPlanExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BizTrainingPlanDO>()
                .likeIfPresent(BizTrainingPlanDO::getPlanName, reqVO.getPlanName())
                .orderByDesc(BizTrainingPlanDO::getId));
    }

}
